package com.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.pojo.Event;
import com.example.pojo.EventDetailVO;
import com.example.pojo.Spot;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface EventMapper extends BaseMapper<Event> {
    @Select("select e.*,s.name as spot_name," +
            "s.location as spot_location,s.image_url as spot_image_url " +
            "from event e " +
            "join spot s on s.id=e.spot_id " +
            "where e.id=${id}")
    EventDetailVO detailWithSpot(Integer id);
}
